// 执行步骤接口
export interface ExecutionStep {
  agentName: string;
  nodeName: string;
  input: string;
  output: string;
  usedTools?: {
    tool: string;
    toolInput: any;
    toolOutput: any;
  }[];
  sourceDocuments?: any[];
  timestamp: string;
}

// 执行追踪接口
export interface ExecutionTrace {
  steps: ExecutionStep[];
  chatMessages: {
    role: "user" | "assistant";
    content: string;
    timestamp?: string;
  }[];
}

// 问答请求接口
export interface AskRequest {
  chatflowId: string;
  question: string;
  userId?: string;
  sessionId?: string;
  overrideConfig?: {
    analytics?: {
      langFuse?: {
        userId: string;
      };
    };
  };
}

// 问答响应接口
export interface AskResponse {
  answer: string;
  executionTrace: ExecutionStep[];
  chatMessages: {
    role: "user" | "assistant";
    content: string;
  }[];
  sessionId: string;
}

// 聊天消息接口
export interface ChatMessage {
  id: string;
  role: "user" | "assistant";
  content: string;
  timestamp: string;
  sessionId?: string;
  traceId?: string;
}

// Flowise 配置接口
export interface FlowiseConfig {
  apiUrl: string;
  apiKey?: string;
  chatflowId: string;
}
